#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import os
import sqlite3
import os, sys


def dict_factory(cursor, row):
    d = {}
    for idx, col in enumerate(cursor.description):
        d[col[0]] = row[idx]
    return d

sqlpath = os.path.expanduser("~")
con = sqlite3.connect(sqlpath+"/stockdate/sql/sqlite.db",check_same_thread=False)
con.row_factory = dict_factory

tcon = sqlite3.connect(sqlpath+"/stockdate/sql/test.db",check_same_thread=False)
tcon.row_factory = dict_factory
